package com.kkb.kkbadmin.domain;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Range;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Component;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * @ClassName ProjectInfo
 * @Description 项目相关信息表
 * @Author 侯兴飞
 * @Date 2021/8/12
 **/

@Component
@Data
@TableName("project_info")
@EqualsAndHashCode(callSuper = false)
@ApiModel("项目对象模型")
public class ProjectInfo implements Serializable {
    @ApiModelProperty("项目ID")
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * @NotNull注解做数据校验：不能为空
     */
    @ApiModelProperty("项目类型：PPT、H5、APP、网页、小程序、其他")
    @TableField("type")
    @NotNull(message = "{projectInfo.filed.notNull}")
    private String type;

    @ApiModelProperty("项目标题")
    @TableField("title")
    @NotNull(message = "{projectInfo.filed.notNull}")
    private String title;

    @ApiModelProperty("项目状态：0报名中、1进行中、2已完成、3已取消")
    @TableField("status")
    @Range(max = 3, min = 0, message = "必须大于等于0或小于等于3")
    @NotNull(message = "{projectInfo.filed.notNull}")
    private Integer status;

    @ApiModelProperty("项目发布的时间")
    @TableField("release_time")
    @NotNull(message = "{projectInfo.filed.notNull}")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date releaseTime;

    @ApiModelProperty("委托方公司信息")
    @TableField("client")
    @NotNull(message = "{projectInfo.filed.notNull}")
    private String client;

    @ApiModelProperty("参会项目的工作方式")
    @TableField("working_mode")
    @NotNull(message = "{projectInfo.filed.notNull}")
    private String workingMode;

    @ApiModelProperty("项目简述")
    @TableField("descibe")
    private String descibe;

    @ApiModelProperty("项目详细描述")
    @TableField("descibe_detail")
    private String descibeDetail;

    @ApiModelProperty("项目报名截止时间")
    @TableField("deadline")
    private Date deadline;

    @ApiModelProperty("项目标签")
    @TableField("label")
    private String label;

    @ApiModelProperty("项目的创建人")
    @TableField("creator")
    private String creator;

    @ApiModelProperty("项目的创建时间")
    @TableField("create_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @NotNull(message = "{projectInfo.filed.notNull}")
    private Date createTime;

    @ApiModelProperty("项目的更新人")
    @TableField("updater")
    private String updater;

    @ApiModelProperty("项目的更新时间 ")
    @TableField("update_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @NotNull(message = "{projectInfo.filed.notNull}")
    private Date updateTime;

    @ApiModelProperty("项目的逻辑删除状态")
    @TableField("is_deleted")
    @TableLogic //逻辑删除
    private Integer deleted;

    //学生已报名人数,排除表字段映射
    @ApiModelProperty("学生已报名人数")
    @TableField(exist = false)
    private Integer stuCount;
    //导师已报名人数,排除表字段映射
    @ApiModelProperty("导师已报名人数")
    @TableField(exist = false)
    private Integer teacherCount;
}
